﻿<cms-table-container ng-if="vm.pageDirectories.length">
    <table>
        <thead>
            <tr>
                <th>Name</th>
                <th># pages</th>
                <th class="lowPriority">Created</th>
                <th cms-table-column-actions>Actions</th>
            </tr>
        </thead>
        <tbody>
            <tr ng-repeat="pageDirectory in ::vm.pageDirectories">
                <td>
                    <span>{{::vm.getPathDepthIndicator(pageDirectory.depth)}}</span>
                    <a ng-href="#/{{::pageDirectory.pageDirectoryId}}">{{::pageDirectory.name }}</a><br>
                    <span class="invisible">{{::vm.getPathDepthIndicator(pageDirectory.depth)}}</span> {{::pageDirectory.fullUrlPath}}
                </td>
                <td>
                    <a ng-href="pages#/?pageDirectoryId={{::pageDirectory.pageDirectoryId}}">{{::pageDirectory.numPages}}</a>
                </td>
                <td class="lowPriority">
                    <cms-table-cell-created-audit-data cms-audit-data="::pageDirectory.auditData"></cms-table-cell-created-audit-data>
                </td>
                <td cms-table-column-actions>
                    <a href="#/{{::pageDirectory.pageDirectoryId}}"
                       class="btn-icon"
                       title="Edit"
                       ng-if="!vm.redirect && vm.canUpdate">
                        <i class="fa fa-pencil-square-o"></i>
                    </a>
                    <a href="#/{{::pageDirectory.pageDirectoryId}}"
                       class="btn-icon"
                       title="Edit"
                       ng-if="vm.redirect && vm.canUpdate">
                        <i class="fa fa-external-link"></i>
                    </a>
                </td>
            </tr>
        </tbody>
    </table>
</cms-table-container>
<span ng-if="!vm.pageDirectories.length">No directories could be found.</span>